/* Import common styles and then override them below */
@import '../interactive-common/common.css';

.toolbar-panel-button {
    border-width: 1px;
    border-style: solid;
    border-color: var(--override-badge-background, var(--vscode-badge-background));
    color: var(--override-foreground, var(--vscode-editor-foreground));
    text-align: center;
    overflow: hidden;
    margin-left: 2px;
    padding: 2px;
    background-color: transparent;
    cursor: hand;
}

.cell-wrapper {
    margin: 2px 2px 0px 0px;
    position: relative;
    min-height: 55px;
}

.cell-wrapper-focused {
    margin: 2px 2px 0px 0px;
}

.cell-wrapper-selected {
    margin: 2px 2px 0px 0px;
}

.cell-menu-bar-outer {
    justify-self: right;
}

.cell-output-wrapper {
    grid-row: 1;
    grid-column: 3;
}

.cell-output {
    margin-top: 5px;
    background: transparent;
    width: 100%;
    overflow-x: scroll;
}

.cell-output-text {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: hidden;
}

.markdown-cell-output-container {
    grid-row: 1;
    grid-column: 3;
}

.markdown-cell-output {
    width: 100%;
    overflow-x: scroll;
}

.cell-outer {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
}

.cell-outer-editable {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    margin-top: 0px;
}

.cell-state-selector {
    border-width: 1px;
    border-style: solid;
    border-color: var(--override-badge-background, var(--vscode-badge-background));
    color: var(--override-foreground, var(--vscode-editor-foreground));
    text-align: center;
    overflow: hidden;
    margin-left: 2px;
    padding: 2px;
    background-color: transparent;
    cursor: hand;
}

.cell-state-selector-option {
    border-width: 1px;
    border-style: solid;
    border-color: var(--override-badge-background, var(--vscode-badge-background));
    color: var(--override-foreground, var(--vscode-editor-foreground));
    background-color: var(--override-background, var(--vscode-editor-background));
}

.code-area {
    position: relative;
    width: 100%;
    padding-right: 8px;
    margin-bottom: 0px;
    padding-left: 2px;
    padding-top: 2px;
    background: var(--override-widget-background, var(--vscode-notifications-background));
}

.markdown-editor-area {
    position: relative;
    width: 100%;
    padding-right: 8px;
    margin-bottom: 0px;
    padding-left: 2px;
    padding-top: 2px;
    background: var(--override-widget-background, var(--vscode-notifications-background));
}

.code-watermark {
    top: 5px; /* Account for extra padding and border in native editor */
}

.cell-input-wrapper {
    grid-column: 3;
    grid-row: 1;
}

.cell-input {
    margin: 2px 10px 0px 0px;
}

.content-div {
    grid-column: 3;
}

.controls-div {
    min-width: 34px;
    padding-left: 4px;
    padding-right: 4px;
    display: block;
    grid-column: 2;
    grid-row: 1;
}

.navbar-div {
    grid-column: 1;
    visibility: hidden;
    display: grid;
    grid-template-rows: var(--button-size) var(--button-size) auto;
}

.navbar-add-button {
    align-self: end;
}

.execution-count {
    justify-self: end;
    margin-bottom: 10px;
    margin-top: 1px;
}

.execution-count-busy-outer {
    justify-self: end;
}

.native-editor-celltoolbar-inner {
    justify-self: center;
    grid-column: 1;
}

.native-editor-celltoolbar-middle {
    display: flex;
    grid-column: 3;
    grid-row: 2;
    justify-items: left;
    background: var(--vscode-notifications-background);
}

.native-editor-celltoolbar-divider {
    background-color: var(--vscode-badge-background);
    height: 2px;
}

.code-toolbar {
    visibility: visible;
}

.markdown-toolbar {
    visibility: collapse;
}

.hover-cell-button {
    visibility: collapse;
}

.cell-wrapper:hover .hover-cell-button {
    visibility: visible;
}

.cell-wrapper-selected .hover-cell-button {
    visibility: visible;
}

.cell-wrapper-focused .hover-cell-button {
    visibility: visible;
}

.delete-cell-button {
    right: 2px;
    position: absolute;
    visibility: collapse;
}

.cell-wrapper:hover .navbar-div {
    visibility: visible;
}

.cell-wrapper-selected .navbar-div {
    visibility: visible;
}

.cell-wrapper-focused .navbar-div {
    visibility: visible;
}

.cell-wrapper:hover .markdown-toolbar {
    visibility: visible;
}

.cell-wrapper-selected .markdown-toolbar {
    visibility: visible;
}

.cell-wrapper-focused .markdown-toolbar {
    visibility: visible;
}

// .cell-wrapper:hover .native-editor-celltoolbar-middle {
//     visibility: visible;
// }

// .cell-wrapper-selected .native-editor-celltoolbar-middle {
//     visibility: visible;
// }

// .cell-wrapper-focused .native-editor-celltoolbar-middle {
//     visibility: visible;
// }

.native-editor-flyout-button {
    width: auto;
    height: auto;
    border-color: transparent;
    background-color: transparent;
    padding: 0px;
    margin-left: 4px;
    margin-right: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    border-width: 0px;
}

.native-editor-flyout-button:focus {
    outline: none;
}

.native-editor-cellflyout {
    position: relative;
    left: 20px;
    top: -15px;
    width: auto;
    height: auto;
    padding-top: 2px;
    padding-right: 2px;
    z-index: 100;
}

.native-editor-cellflyout-selected {
    background-color: var(--vscode-peekView-border);
}

.native-editor-cellflyout-focused {
    background-color: var(--vscode-editorInfo-foreground);
}

.flyout-button-content {
    color: var(--override-foreground, var(--vscode-editor-foreground));
}

.native-button {
    background: transparent;
    z-index: 10;
}

#toolbar-panel {
    margin-top: 2px;
    margin-bottom: 2px;
    margin-left: 0px;
    margin-right: 0px;
}

#content-panel-div {
    overflow: hidden;
}

/* Fix image buttons that are supposed to be hidden from showing up */
.flyout-children-hidden .image-button {
    width: 0px;
    height: 0px;
    margin-left: 0px;
    padding: 0px;
}

.add-cell-line {
    display: flex;
    justify-content: left;
    margin-top: 5px;
    margin-bottom: 0px;
    margin-left: 5px;
    margin-right: 5px;
}

.add-cell-line:focus-within {
    outline: 1px solid black;
}

.add-cell-line-top {
    margin-top: 2px;
    margin-bottom: 0px;
}

.add-cell-line-top-force-visible {
    margin-top: 2px;
    margin-bottom: 0px;
}

.add-cell-line-top .add-cell-line-button {
    visibility: hidden;
}

.add-cell-line-button {
    border-width: 0px;
    border-style: solid;
    text-align: center;
    line-height: 16px;
    background-color: transparent;
    cursor: hand;
    height: var(--button-size);
    padding: 0px;
    display: flex;
}

.add-cell-line-button:focus {
    outline: none;
}

.add-cell-line-top:hover .add-cell-line-button {
    visibility: visible;
}

.add-cell-line-button .image-button-image {
    height: var(--button-size);
}

.add-cell-line-button .image-button-image svg {
    height: var(--button-size);
}

.add-cell-line-divider {
    margin-top: 8px;
    margin-left: 2px;
    width: calc(100% - 40px);
    border-width: 0px;
    border-top-color: var(--override-badge-background, var(--vscode-badge-background));
    border-top-width: 1px;
    border-style: solid;
}

.add-cell-line-divider:hover {
    cursor: pointer;
}

.cell-wrapper-selected .add-cell-line {
    visibility: visible;
}

.cell-wrapper-focused .add-cell-line {
    visibility: visible;
}

/*
Cell Row Container layout
--------------------------
collapse-bar        controls-div        [cell-input, cell-output, markdown-cell-output-container]
(expanded c-bar)    celltoolbar-middle
*/
.cell-row-container {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-rows: 1fr auto;
}

.collapse-bar {
    grid-column: 1;
    grid-row-start: 1;
    grid-row-end: 2;
    background-color: transparent;
    max-width: 8px;
    min-width: 8px;
}

.cell-wrapper:hover .collapse-bar {
    background-color: var(--override-widget-background, var(--vscode-notifications-background));
}

.collapse-bar-markdown {
    margin: 0px 44px 0px 0px;
}

.collapse-bar-output {
    margin: 0px 28px 0px 16px;
}

.collapse-bar-selected {
    background-color: var(--vscode-peekView-border);
    grid-row-start: 1;
    grid-row-end: 3;
}

.collapse-bar-focused {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        var(--vscode-editorGutter-addedBackground) 3px,
        var(--vscode-editorGutter-addedBackground) 6px
    );
    grid-row-start: 1;
    grid-row-end: 3;
}

.cell-wrapper:hover .collapse-bar-selected {
    background-color: var(--vscode-peekView-border);
}

.cell-wrapper:hover .collapse-bar-focused {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        var(--vscode-editorGutter-addedBackground) 3px,
        var(--vscode-editorGutter-addedBackground) 6px
    );
}

.add-divider {
    visibility: hidden;
    margin: 0px;
    position: absolute;
    bottom: 8px;
}

.cell-wrapper:hover .add-divider {
    visibility: hidden;
    z-index: -100;
    pointer-events: none;
}

.cell-wrapper-selected .add-divider {
    visibility: hidden;
    z-index: -100;
    pointer-events: none;
}

.cell-wrapper-focused .add-divider {
    visibility: hidden;
    z-index: -100;
    pointer-events: none;
}

.cell-wrapper-selected:hover .add-divider {
    visibility: hidden;
    z-index: -100;
    pointer-events: none;
}

.cell-wrapper-focused:hover .add-divider {
    visibility: hidden;
    z-index: -100;
    pointer-events: none;
}

.native-editor-celltoolbar-middle .image-button {
    margin-right: 3px;
    margin-top: 4px;
    margin-bottom: 4px;
    margin-left: 3px;
}
